package br.com.sadim.dao;

import java.util.List;

import br.com.sadim.hospital.NotaFiscalConsulta;
import br.com.sadim.hospital.Receituario;

import org.hibernate.Session;

public class NotaFiscalDAOHibernate implements NotaFiscalDAO {
	
	private Session session;
	public void setSession(Session s) {
		session = s;
	}

	@Override
	public void save(NotaFiscalConsulta user) {
		session.save(user);
	}

	@Override
	public void delete(NotaFiscalConsulta user) {
		session.delete(user);
	}

	@Override
	public void update(NotaFiscalConsulta user) {
		session.update(user);
	}

	@Override
	public NotaFiscalConsulta getById(Integer idReceituario) {
		return (NotaFiscalConsulta) session.get(NotaFiscalConsulta.class, idReceituario);
	}


	@SuppressWarnings("unchecked")
	@Override
	public List<NotaFiscalConsulta> getList() {
		return session.createCriteria(NotaFiscalConsulta.class).list();
	}


}
